package com.ruoyi.project.business.domain.model;

import com.ruoyi.project.business.domain.entity.ScheduleDefineMirror;
import com.ruoyi.project.business.domain.model.daily.TimePeriodMirror;
import com.ruoyi.project.business.domain.rules.Rule;
import lombok.Data;

@Data
public class JudgeResult {
    // for month schedule
    private ScheduleDefineMirror scheduleDefine;
    // for daily schedule
    private TimePeriodMirror timePeriod;
    private HardSoftScore score = new HardSoftScore();
    // 1 接受 2拒绝 3终止
    private int result;

    private String tips;

    public boolean isAccept() {
        return result == Rule.RESULT_ACCEPT;
    }

    public void mergeScore(HardSoftScore toMerge) {
        this.score.merge(toMerge);
    }

    public boolean isStopRule() {
        return result == Rule.REJECT_AND_CONTINUE_TASK;
    }

    public boolean isStopTask() {
        return result == Rule.STOP_TASK;
    }
}
